<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
<script type="text/javascript">
    window.onload = function() {
        document.getElementById("one").outerHTML = "<div style='width:100px;height:100px; background-color:silver;'></div>";
    }
</script>

<p id="one" style="background-color:gold;">
    TEXT
</p>
</body>
</html>